import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;

import Images;

class Kidnaping
{
  public var addedPrincess:Bool;
  public var addedVillian:Bool;
  public var addedHero:Bool;
  public var HasPrincess:Bool;
  public var currentState:String;
  public var HasVillian:Bool;
  public var HasHero:Bool;
  public var FramesLeft:Float;
  public var PrincessAvatar:CustomSprite;
  public var VillianAvatar:CustomSprite;
  public var HeroAvatar:CustomSprite;
  public var PostionX:Int;
  public var PostionY:Int;
  public var addAvatars:Bool;
  public function new() {
  addedPrincess = false;
  addedVillian = false;
  addedHero = false;
    HasPrincess = false;
    HasVillian = false;
    HasHero = false;
    addAvatars = true;
    FramesLeft = 0;
    currentState = "addPrincess";

  PrincessAvatar = new CustomSprite();
  PrincessAvatar.graphics.beginFill(0xFFFFFF);
  PrincessAvatar.graphics.lineStyle(1);
  PrincessAvatar.graphics.drawRect(0,0,25,25);
  PrincessAvatar.graphics.endFill();
  PrincessAvatar.x = 100;PrincessAvatar.y= 250;
  
  var PrincessPic = new CustomSprite();
  PrincessPic.graphics.beginBitmapFill(new Princess());
  PrincessPic.graphics.drawRect(0, 0, 25,25);
  var Text = new TextField();
  Text.htmlText = "<font size='20'>P</font>";
  Text.width = 25;
  Text.x =5;
  //PrincessAvatar.addChild(Text);
  PrincessAvatar.addChild(PrincessPic);

  VillianAvatar = new CustomSprite();
  VillianAvatar.graphics.beginFill(0xFFFFFF);
  VillianAvatar.graphics.lineStyle(1);
  VillianAvatar.graphics.drawRect(0,0,25,25);
  VillianAvatar.graphics.endFill();
  VillianAvatar.x = 0;VillianAvatar.y= 250;

  var Text = new TextField();
  Text.htmlText = "<font size='20'>V</font>";
  Text.width = 25;
  Text.x =5;

  var VillianPic = new CustomSprite();
  VillianPic.graphics.beginBitmapFill(new Villian());
  VillianPic.graphics.drawRect(0, 0, 25,25);
  //VillianAvatar.addChild(Text);
  VillianAvatar.addChild(VillianPic);

  HeroAvatar = new CustomSprite();
  HeroAvatar.graphics.beginFill(0xFFFFFF);
  HeroAvatar.graphics.lineStyle(1);
  HeroAvatar.graphics.drawRect(0,0,25,25);
  HeroAvatar.graphics.endFill();
  HeroAvatar.x = 0;HeroAvatar.y= 250;

  var HeroPic = new CustomSprite();
  HeroPic.graphics.beginBitmapFill(new Hero());
  HeroPic.graphics.drawRect(0, 0, 25,25);
  HeroAvatar.addChild(HeroPic);

  var Text = new TextField();
  Text.htmlText = "<font size='20'>H</font>";
  Text.width = 25;
  Text.x =5;
  //HeroAvatar.addChild(Text);
  }

  public function draw()
  {

  PrincessAvatar.graphics.beginFill(0xFFFFFF);
  PrincessAvatar.graphics.lineStyle(1);
  PrincessAvatar.graphics.drawRect(0,0,25,25);
  PrincessAvatar.graphics.endFill();
  
  var PrincessPic = new CustomSprite();
  PrincessPic.graphics.beginBitmapFill(new Princess());
  PrincessPic.graphics.drawRect(0, 0, 25,25);
  //PrincessAvatar.addChild(Text);
  PrincessAvatar.addChild(PrincessPic);

  VillianAvatar.graphics.beginFill(0xFFFFFF);
  VillianAvatar.graphics.lineStyle(1);
  VillianAvatar.graphics.drawRect(0,0,25,25);
  VillianAvatar.graphics.endFill();

  var VillianPic = new CustomSprite();
  VillianPic.graphics.beginBitmapFill(new Villian());
  VillianPic.graphics.drawRect(0, 0, 25,25);
  VillianAvatar.addChild(VillianPic);

    HeroAvatar.graphics.beginFill(0xFFFFFF);
    HeroAvatar.graphics.lineStyle(1);
    HeroAvatar.graphics.drawRect(0,0,25,25);
    HeroAvatar.graphics.endFill();

    var HeroPic = new CustomSprite();
    HeroPic.graphics.beginBitmapFill(new Hero());
    HeroPic.graphics.drawRect(0, 0, 25,25);
    HeroAvatar.addChild(HeroPic);

  }
}